ITU-T Recommendation H.264/MPEG-4 Part 10/AVC for advanced video coding includes transforming image blocks, e.g., 4×4 blocks, quantizing the coefficients, ordering the (quantized) coefficients to a sequence of ordered quantized coefficients, and then encoding the ordered sequence of quantized coefficients by what is called entropy coding. The standard specifies two types of entropy coding: Context-based Adaptive Binary Arithmetic Coding (CABAC) and context-based adaptive variable length coding (CAVLC). The latter is included in the Baseline Profile of H.264. CAVLC as defined in H.264 encodes the ordered quantized coefficients of a 4×4 block in a reverse order. In other words, the ordered sequence of quantized coefficients starts with the nonzero coefficient with the highest frequency and progresses the coefficient at the lowest frequency.
CAVLC uses a one-dimensional position coding scheme to code the positions of nonzero coefficients, e.g., the length of a run of zero-valued coefficients preceding a nonzero-valued coefficient. The existing position coding scheme for CAVLC includes selecting variable length coding tables that depend only on the number of zeros remaining. The number of nonzero coefficients remaining, although also known to both the encoder and decoder, is not typically used in the coding process.